package indexOfExtends;

public class superIndex {
    public static void main(String[] args) {
       ZI2 z2=new ZI2();
       z2.fushow();
       FU2 z3=new ZI2();
    }
}
class    FU2{
    public FU2(){
        System.out.println("父类的空参构造");
    }
    public String name="fu";
    public void fushow(){
        System.out.println("fushow");
    }

}
class ZI2 extends FU2{
    public ZI2(){
        super();//必须写在第一行
        System.out.println("子类的空参构造");
    }
    public String name="zi";
    public void ziShow(){
        System.out.println("zishow");
    }

    public void method(){
        //就近原则
        //为了区别重名的变量 为了区别
        String name="onshow";
        System.out.println(name); //局部的
        System.out.println(this.name); //成员的
        System.out.println(super.name); //父类的
        this.ziShow();
        super.fushow();

    }
}